import cn.edu.hbsi.dao.OrdersItemDao;
import cn.edu.hbsi.utils.GetSqlSessionUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.After;
import org.junit.Test;

import java.util.Iterator;
import java.util.List;

public class testOrdersItem
{
    private SqlSession sqlSession = GetSqlSessionUtil.getSqlSession();
    private OrdersItemDao ordersItemDao = sqlSession.getMapper(OrdersItemDao.class);

    @Test
    public void testSelectPIdByOId(){
        Integer oId = 3;

        List<Integer> list = ordersItemDao.selectPIdByOId(oId);
        Iterator var = list.iterator();
        while (var.hasNext()){
            Integer integer = (Integer) var.next();
            System.out.println((int)integer);
        }
    }

    @After
    public void destory(){
        sqlSession.commit();
        sqlSession.close();
    }
}
